<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateMoneyboxInTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('moneybox_in', function (Blueprint $table) {
            $table->id()->from(config('migration.from'));

            $table->uuid('transaction_uid');
            $table->timestamp('transaction_date');

            $table->string('account');
            $table->string('name');
            $table->float('amount')->default(0);
            $table->string('payment_destination');

            $table->jsonb('body')->default(json_encode([]));
            $table->integer('response_code')->nullable();
            $table->string('response_text')->nullable();

            $table->string('inn')->nullable();
            $table->string('bik')->nullable();
            $table->string('kpp')->nullable();
            $table->string('commission')->nullable();
            $table->string('acquiring_commission')->nullable();
            $table->string('acquiring_payment_id')->nullable();
            $table->string('c2b_qr_code_id')->nullable();

            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('moneybox');
    }
}
